<script setup lang="ts">
import { ref,onMounted, reactive } from 'vue'
import { login , testReq,testNewReq} from '@/api/user'
defineProps<{ msg: string }>()

const count = ref(0)
const state=reactive({
  msgg:'443434'
})
onMounted(() => {
  login({ account: 'admin', password: '123456' }).then(res => {
    console.log(res)
    console.log( res.data.token+"~~11111")
    state.msgg=res.data.token||''
   
  })
  testNewReq({start: 1,end: 2,keyword: '111', page: 1,pageSize: 10,}).then(res => {
    console.log(res,"~~~~~~~~~~~res~~~")
   
  })
  testReq({start: 1,end: 2,keyword: '111', page: 1,pageSize: 10,}).then(res => {
    console.log(res)
  })
})

</script>

<template>
  <h1>{{ state.msgg +"~~~~3232~~~~~~"}}</h1>

  <div class="card">
    <button type="button" @click="count++">count is {{ count }}</button>
    <p>
      Edit
      <code>components/HelloWorld.vue</code> to test HMR
    </p>
  </div>

  <p>
    Check out
    <a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
      >create-vue</a
    >, the official Vue + Vite starter
  </p>
  <p>
    Install
    <a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
    in your IDE for a better DX
  </p>
  <p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>

<style scoped>
.read-the-docs {
  color: #888;
}
</style>
